import request from '/@/utils/request'
import { AxiosResponse } from 'axios'
const api = {
    getAppList: 'https://mockapi.eolinker.com/KcVESPP530f8c4bff158bde5ccdf030722ce75ff2376275/api/appList',
    createApp:'https://mockapi.eolinker.com/KcVESPP530f8c4bff158bde5ccdf030722ce75ff2376275/api/createApp',
    deleteApp:'https://mockapi.eolinker.com/KcVESPP530f8c4bff158bde5ccdf030722ce75ff2376275/api/updateApp',
    updateApp:'https://mockapi.eolinker.com/KcVESPP530f8c4bff158bde5ccdf030722ce75ff2376275/api/updateApp'
}
export interface ITableList {
    pageInfo:object,
    name: string
}


export function getAppList(tableList: ITableList): Promise<AxiosResponse<IResponse>> {
    return request({
        url: api.getAppList,
        method: 'POST',
        data: tableList
    })
}

export interface ICreateApp {
    id?:string
    name: string
    ip: string
    address: string
}
export function createApp(params: ICreateApp): Promise<AxiosResponse<IResponse>> {
    return request({
        url: api.createApp,
        method: 'POST',
        data: params
    })
}

export function updateApp(params: ICreateApp): Promise<AxiosResponse<IResponse>> {
    return request({
        url: api.updateApp,
        method: 'POST',
        data: params
    })
}

export function deleteApp(params:any): Promise<AxiosResponse<IResponse>> {
    return request({
        url: api.deleteApp,
        method: 'POST',
        data: params
    })
}



